To run ggggnnnnuuuuppppllllooootttt interactively, but under the control of a
program, only ooooppppeeeennnnGGGGnnnnuuuuppppllllooootttt(((()))), wwwwrrrriiiitttteeeeGGGGnnnnuuuuppppllllooootttt(((()))), rrrreeeeaaaaddddGGGGnnnnuuuuppppllllooootttt(((()))),
cccclllloooosssseeeeGGGGnnnnuuuuppppllllooootttt(((()))), and perhaps rrrreeeeaaaaddddEEEErrrrrrrroooorrrrGGGGnnnnuuuuppppllllooootttt(((()))) need ever be
called. The output will appear graphically on whatever
successful read [should return the number of characters
actually copied into _b_u_f on success], and -1 if any input
parameters were invalid. Use this read to get status-type
information from ggggnnnnuuuuppppllllooootttt,,,, such as the response to a ``show''
command. rrrreeeeaaaaddddCCCCuuuurrrrvvvveeeeGGGGnnnnuuuuppppllllooootttt(((()))) completely processes the
returned data after a ``plot _e_x_p_r'' or a ``splot _e_x_p_r''
command has been written with wwwwrrrriiiitttteeeeGGGGnnnnuuuuppppllllooootttt(((()))). A pointer to
a GPCurve struct is returned on success, which contains
_n_p_t_s, the number pf points returned, float arrays _x[] and
_y[] (allocated by mmmmaaaalllllllloooocccc(3) to _n_p_t_s). _r_a_n_g_e[] is a character
flag array which tells whether each point is inrange,
(inside the plot bounds), outrange (outside of the plot
bounds but still defined), or undefined (eg. in the case of
infinities occurring in the interval over which the
expression was evaluated). The flag _i_s__2_d will be TRUE if
the data is a 2D line plot (``plot'' command) and the _z
pointer will be NULL. If the curve represents the output
from a 3D surface plot (``splot'' command), _i_s__2_d will be
FALSE and _z[] will be allocated just like _x[] and _y[].
typedef struct {
unsigned npts; /* number of points */
int is_2d; /* True: only x,y are valid; z=NULL */
int curveno; /* Curve id number */
float *x; /* x[npts] */
float *y; /* y[npts] */
float *z; /* z[npts] */
char *range; /* range[npts]: 'i' inrange,
'o' outrange,
'u' undefined */
} GPCurve;
If the application writes a plot command requesting more
than one curve, eg. ``plot sin(x),x*cos(x),bessj0(x)'' then
the application should call rrrreeeeaaaaddddCCCCuuuurrrrvvvveeeeGGGGnnnnuuuuppppllllooootttt(((()))) as many times
as necessary to retrieve all the curve data. The _c_u_r_v_e_n_o
field will be set with curve identifier number (Note: unique
_o_n_l_y to that specific plot command). NULL is returned if
any input parameters are invalid or rrrreeeeaaaaddddCCCCuuuurrrrvvvveeeeGGGGnnnnuuuuppppllllooootttt(((()))) if
can't mmmmaaaalllllllloooocccc(3) all the space it needs.
cccclllloooosssseeeeGGGGnnnnuuuuppppllllooootttt(((()))) shuts down a connection to ggggnnnnuuuuppppllllooootttt. If
_q_u_i_t_f_l_a_g is non-zero, a ``quit'' command will be sent first
to ggggnnnnuuuuppppllllooootttt to allow for a graceful exit. Then the pipe
connections will be closed. A 0 is returned if
ppppcccclllloooosssseeee____iiiiooooeeee(3L) fails and a 1 for successful close.
The routines rrrreeeeaaaaddddCCCCuuuurrrrvvvveeeeHHHHeeeeaaaaddddGGGGnnnnuuuuppppllllooootttt(((()))), rrrreeeeaaaaddddCCCCuuuurrrrvvvveeee2222GGGGnnnnuuuuppppllllooootttt(((()))),
and rrrreeeeaaaaddddCCCCuuuurrrrvvvveeee3333GGGGnnnnuuuuppppllllooootttt(((()))) provide the application with more
control by doing the job of rrrreeeeaaaaddddCCCCuuuurrrrvvvveeeeGGGGnnnnuuuuppppllllooootttt(((()))) in pieces.
For example, rrrreeeeaaaaddddCCCCuuuurrrrvvvveeeeHHHHeeeeaaaaddddGGGGnnnnuuuuppppllllooootttt(((()))) returns only the curve
id number and number of points into _c_u_r_v_e_n_o and _n_p_t_s,